
             
/**
 * 
 *
 * @File name:  DeleteTPersonnalAction.java   删除【人员信息:T_PERSONNAL】
 * @Create on:  2011-10-30 23:38:948
 * @Author   :  陈伟
 *
 * @ChangeList
 * ---------------------------------------------------
 * Date         Editor              ChangeReasons
 *
 */
           
        
package com.boho.estates.staff.action;

            
import java.sql.Connection;
import java.util.Date;

import cn.boho.framework.actions.ActionImp;
import cn.boho.framework.context.ActionContext;
import cn.boho.framework.exception.UserOperationException;
import cn.boho.framework.po.POUtils;
import cn.boho.framework.service.MessageService;

import com.boho.common.Constant;
import com.boho.common.SystemUtils;
import com.boho.estates.po.TPersonnalPO;
            
        

public class DeleteTPersonnalAction extends ActionImp {
	private TPersonnalPO conditionPersonnalPO = new TPersonnalPO();
	private TPersonnalPO valuePersonnalPO = new TPersonnalPO();
	private Connection con=null;
	@Override
	protected void doException(ActionContext atx, Exception ex) {
		if (!(ex instanceof UserOperationException)) {
			atx.setErrorContext("BOHO_COMMON_1003", MessageService.getMessage("BOHO_COMMON_1003"),"【人员信息】", ex);
		}
	}
	@Override
	protected int performExecute(ActionContext atx) throws Exception {
		String updateBy = SystemUtils.getSessionUser(atx);
		valuePersonnalPO.setIsValid(Constant.IS_VALID_FALSE);
		valuePersonnalPO.setUpdateBy(updateBy);
		valuePersonnalPO.setUpdateDate(new Date());
		POUtils.update(con, conditionPersonnalPO, valuePersonnalPO, false);
		logger.info("删除操作：" + updateBy + "@"+ new Date(System.currentTimeMillis())+ "删除表：【人员信息:T_PERSONNAL】 主键【"+ atx.getStringValue("PERSONNAL_NO") + "|"+"】");
		return 1;
	}
	@Override
	protected int verifyParameters(ActionContext atx) throws Exception {
		con = atx.getConection();
		conditionPersonnalPO.setPersonnalNo(atx.getIntegerValue("PERSONNAL_NO",-1));
		return 1;
	}
}
